package com.cp.controler;

import com.cp.model.Userinfo;
import com.cp.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UserController {
    @Autowired
    private UserService userServiceL;

    @RequestMapping("getAll")
    public List<Userinfo> getAll(){
        List<Userinfo> list = userServiceL.findAll();
        return list;
    }
    @RequestMapping("getRedis")
    public String getRedis(){
        String str = userServiceL.getRedis();
        return str;
    }
    @RequestMapping("getById")
    public List<Userinfo> getById(){
        List<Userinfo> list = userServiceL.findById(8);
        return list;
    }
}
